<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="选择计量单位" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script language="javascript">
	function doSelect(index){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr=null;
		if ( ob_arr.length>=index ){
			arr = new Array(ob_arr[index-1].value,ob_arr[index-1].getAttribute("unit_name"));
		}
		if (arr != null){
			parent.popRetVal=arr;
			parent.ClosePop();
		}
	}
	function doCancel(){
		parent.ClosePop();
	}
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr=null;
		if ( ob_arr.length>=it.getAttribute("index") ){
			arr = new Array(ob_arr[it.getAttribute("index")-1].value,ob_arr[it.getAttribute("index")-1].getAttribute("unit_name"));
		}
		if(arr==null){
			return;
		}
		parent.popRetVal=arr;
		parent.ClosePop();
	}
	function doInit(){
		Window_Onload();
	}
</script>
</head>
<body oncontextmenu="return false" onload="doInit();" class="sheet">
<div class="sheet-main" style="width:255px">
  <div class="sheet-top">
    <div class="content">
      <h2>选择计量单位</h2>
      <p>鼠标双击可以选中计量单位</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
      <div class="table-list">
        <table width="100%">      
 					<tr >
					<th width="14"></th>
					<th width="70%">名称</th>
					<th width="30%">操作</th>
				</tr>
				<c:forEach var="item" items="${unitList}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td><input type="radio" name='query_checkbox' value="${item.id}" unit_name="${item.unitName}"></td>
						<td>${item.unitName}</td>
						<td>
							<a href="javascript:doSelect('${i.index+1}');">选择</a>
						</td>
					</tr>
				</c:forEach>
			</table>
      </div>
    </div>
  </div>
</div>
</body>
</html>